﻿namespace Ngs
{
    using System;

    public static class EventFactory
    {
        public static void RaiseEvent<TArgs>(object sender, EventHandler<TArgs> eventHandler, TArgs args) 
            where TArgs : EventArgs
        {
            // Protect against multi-threaded code
            EventHandler<TArgs> handler = eventHandler;
            if (handler != null)
            {
                handler(sender, args);
            }
        }
    }
}
